﻿using System.Configuration;
using System.Data;
using System.IO;
using System.Windows;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace WpfApp1;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
    //// The.NET Generic Host provides dependency injection, configuration, logging, and other services.
    //// https://docs.microsoft.com/dotnet/core/extensions/generic-host
    //// https://docs.microsoft.com/dotnet/core/extensions/dependency-injection
    //// https://docs.microsoft.com/dotnet/core/extensions/configuration
    //// https://docs.microsoft.com/dotnet/core/extensions/logging
    //private static readonly IHost _host = Host.CreateDefaultBuilder()
    //    .ConfigureAppConfiguration(c =>
    //    {
    //        c.SetBasePath(Path.GetDirectoryName(AppContext.BaseDirectory));
    //    })
    //    .ConfigureServices(
    //        (context, services) =>
    //        {
    //            // App Host
    //            services.AddHostedService<ApplicationHostService>();

    //            // Page resolver service
    //            services.AddSingleton<IPageService, PageService>();

    //            // Theme manipulation
    //            services.AddSingleton<IThemeService, ThemeService>();

    //            // TaskBar manipulation
    //            services.AddSingleton<ITaskBarService, TaskBarService>();

    //            // Service containing navigation, same as INavigationWindow... but without window
    //            services.AddSingleton<INavigationService, NavigationService>();

    //            // Main window with navigation
    //            services.AddSingleton<INavigationWindow, MainWindow>();
    //            services.AddSingleton<ViewModels.MainWindowViewModel>();

    //            // Views and ViewModels
    //            services.AddSingleton<Views.Pages.DashboardPage>();
    //            services.AddSingleton<ViewModels.DashboardViewModel>();
    //            services.AddSingleton<Views.Pages.DataPage>();
    //            services.AddSingleton<ViewModels.DataViewModel>();
    //            services.AddSingleton<Views.Pages.SettingsPage>();
    //            services.AddSingleton<ViewModels.SettingsViewModel>();

    //            // Configuration
    //            services.Configure<AppConfig>(context.Configuration.GetSection(nameof(AppConfig)));
    //        }
    //    )
    //    .Build();
}